<?php

namespace app\qsapi\model;

use think\Model;

class BaseModel extends Model
{


    /**
     * 根据查询条件获取单条信息
     * @param $where
     * @param $field
     * @return BaseModel
     */
    public function getInfoByWhere($where = [], $field = '*')
    {
        return $this->field($field)->where($where)->find();
    }

    public function insertRow($data)
    {
        return $this->insertGetId($data);
    }

    public function updateRow($where, $data)
    {
        return $this->where($where)->update($data);
    }

}